<template>
  <div>
    <div gap="10px 10px">
      <div>
        <div class="container">
          <div class="box">
            <p class="center">
              <img :src="'/web/binary/image?model=res.users&field=image_small&id='+ uid">
            </p>
          </div>
        </div>
      </div>
      <Button
        type="warn"
        @click.native="cancelLogin"
      >
        退出登录
      </Button>
    </div>
  </div>
</template>

<script>
  import {Button} from 'vant';

  export default {
  name: 'OdooUser',
  components: {
    // Panel,
    // Box,
    Button
    // Field
  },
  data: function () {
    return {
      uid: 0
    }
  },
  computed: {},
    mounted: function () {
    if (!localStorage.getItem('uid')) {
      this.$router.push({
        path: '/'
      })
    }
    this.uid = localStorage.getItem('uid')
  },
  methods: {
    cancelLogin: function () {
      localStorage.setItem('uid', null)
      this.$router.push({name: 'login'})
    }
  }
}
</script>
<style scoped>
  .container {
    align-items: center;
    display: flex;
    justify-content: center;
    height: 100%;
    width: 100%;
  }

  .center {
    text-align: center;
    padding-top: 20px;
    color: #fff;
    font-size: 18px;
  }

  .center img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #ececec;
  }

  .box {
    background-image: url("https://odoo.net.cn/uploads/profile/6861-profileimg.jpg");
    border-radius: 5px;
    font-family: sans-serif;
    text-align: center;
    line-height: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 100%;
    max-height: 100%;
    padding: 20px 40px;
  }
</style>
